﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Microsoft.Xna.Framework;

namespace Oroboros.Objects
{
    public class QuaternionWrapper: INotifyPropertyChanged
    {
        private Quaternion m_Quat;
        public event PropertyChangedEventHandler PropertyChanged;
        public void Changed(string n)
        {
            if (!string.IsNullOrEmpty(n))
                PropertyChanged(this, new PropertyChangedEventArgs(n));
        }

        public QuaternionWrapper()
        {
            this.m_Quat = Quaternion.Identity;
        }

        public QuaternionWrapper(Quaternion vector)
        {
            this.m_Quat = vector;
        }

        public QuaternionWrapper(float p_x, float p_y, float p_z, float p_w)
        {
            this.m_Quat = new Quaternion(p_x, p_y, p_z, p_w);
        }

        public float X { get { return m_Quat.X; } set { Changed("X"); m_Quat.X = value; } }
        public float Y { get { return m_Quat.Y; } set { Changed("Y"); m_Quat.Y = value; } }
        public float Z { get { return m_Quat.Z; } set { Changed("Z"); m_Quat.Z = value; } }
        public float W { get { return m_Quat.W; } set { Changed("Z"); m_Quat.W = value; } }
    }
}
